#!/usr/bin/env bash

# Toggle all window between floating and bsp.
# Only works when the workspace layout is bsp, i.e., the windows in it are tiled.

# mkdir -p ~/Desktop/test22

spaceType=$(yabai -m query --spaces --space | jq .type)
if [ $spaceType = '"bsp"' ]; then
    yabai -m space --layout float && yabai -m config window_border off
else
    yabai -m space --layout bsp && yabai -m config window_border on
fi


